//
//  HWTypeleibieCollectionViewCell.m
//  HWanGame
//
//  Created by 陈道斌 on 2019/10/18.
//  Copyright © 2019 Chendaobin. All rights reserved.
//

#import "HWTypeleibieCollectionViewCell.h"

@implementation HWTypeleibieCollectionViewCell


- (instancetype)initWithFrame:(CGRect)frame {
    
    if (self = [super initWithFrame:frame]) {
       
        [self setupUI];
    }
    
    return  self;
}

- (void)setupUI {
    
       self.miashulabel = [[UILabel alloc]initWithFrame:CGRectMake(0,  0, 75, 30)];
       self.miashulabel.text = @"全部";
      self.miashulabel.textColor = RGB(102, 102 , 102);
      self.miashulabel.font = [UIFont systemFontOfSize:12];
      self.miashulabel.backgroundColor = RGB(244, 244, 244);
      self.miashulabel.textAlignment  = NSTextAlignmentCenter;
      self.miashulabel.layer.cornerRadius = 6;
      self.miashulabel.layer.masksToBounds = YES;
      [self addSubview:self.miashulabel];
    
    
    
}


-(void)setModel:(HWTypeleibieModel *)model {
    
    _model = model;
    self.miashulabel.text = model.name;
    

    
    if (model.xuazhong) {
        
        self.miashulabel.textColor = RGB(26, 113 , 255);
        self.miashulabel.backgroundColor = RGB(223, 235, 255);
        
        
    } else {
        
         self.miashulabel.textColor = RGB(102, 102 , 102);
         self.miashulabel.backgroundColor = RGB(244, 244, 244);
        
    }
    
    
    
    
}


-(void)setReYouBanModel:(HWTypeleibieModel *)reYouBanModel {
    
    _reYouBanModel = reYouBanModel;
    
    
    
    self.miashulabel.font = [UIFont systemFontOfSize:10];
    self.miashulabel.frame = CGRectMake(0, 0, 42, 20);

    self.miashulabel.text = reYouBanModel.name;
    
    self.miashulabel.layer.cornerRadius = 10;
    self.miashulabel.layer.masksToBounds= YES;
    self.miashulabel.layer.borderWidth = 1;
    
    
    

    
    if (reYouBanModel.xuazhong) {
        
        self.miashulabel.textColor =RGB(248, 119, 6);
        self.miashulabel.backgroundColor = RGB(255, 241, 228);
        self.miashulabel.layer.borderColor = RGB(248, 119, 6).CGColor;
        
        
        
    } else {
        
         self.miashulabel.textColor = RGB(136, 136 , 136);
         self.miashulabel.backgroundColor = RGB(255, 255, 255);
            self.miashulabel.layer.borderColor =RGB(204, 204, 204).CGColor;
        
    }
    
    
    
}

@end
